package com.taotao.common.mqclient;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.jms.Topic;

/**
 * Created by zhang_xming on 2017/2/19.
 * activemq
 */
@Component
public class JmsClient {
    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

//    @Autowired
//    private Queue queue;
    @Autowired
    private Topic topic;

//    public void sendQueue(String msg) {
//        this.jmsMessagingTemplate.convertAndSend(this.queue, msg);
//    }
    public void sendTopic(String msg) {
        this.jmsMessagingTemplate.convertAndSend(this.topic, msg);
    }

//    @JmsListener(destination = "zxm.queue")
//    public void receiveQueue(String text) {
//        System.out.println("接受到：" + text);
//    }


}
